package me.ymfs.springboot.guice.service;

import com.google.inject.AbstractModule;
import me.ymfs.springboot.guice.service.order.OrderModule;
import me.ymfs.springboot.guice.service.user.UserModule;
import org.springframework.context.ApplicationContext;

public class AppModule extends AbstractModule {

    private final ApplicationContext context;

    public AppModule(ApplicationContext context) {
        this.context = context;
    }

    @Override
    protected void configure() {
        bind(ApplicationContext.class).toInstance(this.context);
        install(new UserModule());
        install(new OrderModule());
    }
}
